package com.sdj.quick.web.controller;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.sdj.quick.web.dto.BindCardDto;

/***
 * 快捷绑卡测试
 * @author Administrator
 *
 */

@Controller
@RequestMapping("/bind")
public class BindCardController extends BaseController{

	@RequestMapping("/toBindCard")
	public String toBindCard(){
		return "quickBindCard";
	}
	
	@RequestMapping(value="/bindCard",method=RequestMethod.POST)
	public @ResponseBody String bindCard(BindCardDto bindCardDto){
		logger.info("快捷绑卡发送请求参数对象:【{}】",bindCardDto);
		String merKey = bindCardDto.getMerKey();
		String path = quickConfig.getBindCardUrl();
		Map<String,String> map = getPostResult(path,merKey,bindCardDto);
		return JSON.toJSONString(map);
	}
	public static void main(String[] args) throws NoSuchAlgorithmException {
		System.out.println(Integer.MAX_VALUE);
		MessageDigest md = MessageDigest.getInstance("MD5");
		byte[] b = md.digest(new String("hha").getBytes());
		System.out.println(new String());
	}
}
